<?php
ini_set('display_errors', 1);
error_reporting(-1);
ini_set('memory_limit', '512M');
require_once '/data/wwwroot/g_vendor/autoload.php';


//修复res_id 未在wiki中
use Biz\model\wiki\Wiki;
use Doraemon\model\Store\ShenJianGoods;

$list = ShenJianGoods::select(['item_id', 'id'],['id[>]'=>5864]);
var_dump(count($list));
$itemIds = array_column($list, 'item_id');
$res = Wiki::select('channel_spu_id', ['channel' => 1, 'channel_spu_id' => $itemIds]);
$itemIds = array_diff($itemIds, $res);
var_dump(count($itemIds));
foreach ($list as $row) {
    if (in_array($row['item_id'], $itemIds)) {
        $result = [
            'code' => 1,
            'data' => ['id' => $row['id']]
        ];
        //3.20.0 需要sign参数
        \Biz\service\wiki\WikiClean::clean('转换wiki', $result);
    }
}